package com.example.observer;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

public class MainActivity {

    public static void main(String[] args) {
        SubscrptionSubject subscrptionSubject = new SubscrptionSubject();
        WeixinUser user1 = new WeixinUser("杨影枫");
        WeixinUser user2 = new WeixinUser("月眉儿");
        WeixinUser user3 = new WeixinUser("紫轩");
        subscrptionSubject.attach(user1);
        subscrptionSubject.attach(user2);
        subscrptionSubject.attach(user3);
        subscrptionSubject.notify("更新");
    }
}